Fix AAA dot1x YANG choice violations causing configuration drift #57
+17
−16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes critical YANG choice constraint violation in AAA dot1x/enable authentication
configuration that caused state/reality drift and device configuration failures.
Problems Fixed
Problem 1: YANG Choice Constraint Violation
When configuring dot1x authentication with custom RADIUS/TACACS+ groups:
Module Input:
Expected Device CLI:
Actual Device CLI (before fix):
Terraform showed configuration applied successfully in state, but device had incorrect
authentication methods configured.
Problem 2: Array Index Logic Error
Module was incorrectly checking methods[3] when evaluating methods[1], causing
out-of-bounds errors and incorrect group name retrieval for authentication method lists.
Root Causes
Module was violating YANG choice constraint by setting multiple mutually-exclusive options
simultaneously.
Provider Resource Arguments (before fix):
From Cisco-IOS-XE-aaa.yang:
Issue: Module set unused choice options to false → Terraform coerced to string "false" →
Provider serialized ALL values → RESTCONF applied last value (cache false) and ignored the
intended value (group).
BEFORE (iosxe_aaa.tf):
AFTER (iosxe_aaa.tf):
Verification
Device CLI (after fix):